<taglib name="Common\TagLib\Sohtml"/>
<div class="main-title"><h2>{$meta_title}</h2></div>
<div class="main-controller">    <!-- 按钮控制区 -->
    
        <a href="#" class="btn-check">全选</a>
        <a href="#" class="btn-refresh lnk-refresh">刷新</a>
    <!-- /按钮控制区 -->
</div>
<!-- 列表 -->
<form method="post" action="{:U('Permission/role_rules_save')}">
    <div style="max-width:450px; max-height: 600px; overflow: auto; margin-bottom: 10px;">
    <sohtml:tree datasource="rule_list" value="{$rule}" />
    </div>
    <input type="hidden" name="id" value="{$id}" />
    <button type="submit">保存</button><button type="reset">重置</button>
</form>
<!-- /列表 -->
<script type="text/javascript">
    // 全选 2015-3-26 SoChishun Added.
    $('.btn-check').click(function () {
        var $this = $(this).find('.ui-button-text');
        if ('全选' == $this.text()) {
            $this.text('取消');
            $('form :checkbox').prop('checked', true);
        } else {
            $this.text('全选');
            $('form :checkbox').prop('checked', false);
        }
    })
</script>